<.focus_box>
  <:title>
    Transfer ownership of {@site.domain}
  </:title>
  <:subtitle>
    Enter the email address of the new owner. We will contact them over email to
    offer them the ownership of {@site.domain}. If they don't respond in 48
    hours, the request will expire automatically. <br /><br />
    Do note that a subscription plan is not transferred alongside the site. If
    they accept the transfer request, the new owner will need to have an active
    subscription. Your access will be downgraded to <b>guest editor</b>
    and any other
    member roles will stay the same.
  </:subtitle>
  <.form
    :let={f}
    for={@conn}
    action={Routes.membership_path(@conn, :transfer_ownership, @site.domain)}
  >
    <%= if @conn.assigns[:error] do %>
      <div class="text-red-500 text-xs mt-1">{@conn.assigns[:error]}</div>
    <% end %>

    <div class="my-6">
      <.input
        type="email"
        field={f[:email]}
        label="Email address"
        placeholder="joe@example.com"
        required="true"
      />
    </div>

    <.button type="submit" class="w-full" mt?={false}>Request transfer</.button>
  </.form>
</.focus_box>
